//
//  UIBarButtonItem+Extensions.swift
//  weibo
//
//  Created by 长城 on 16/12/9.
//  Copyright © 2016年 dhsr. All rights reserved.
//

import UIKit
extension UIBarButtonItem{
    
    ///创建UIBarButtonItem
    ///
    /// - Parameters:
    ///   - title: title
    ///   - target: target
    ///   - action: action
    convenience init(title : String,target : AnyObject,action : Selector) {
        let btn = UIButton(type: .system)
        btn.frame = CGRect(x: 0, y: 0, width: 50, height: 50)
        btn.setTitle(title, for: .normal)
        btn.setTitleColor(#colorLiteral(red: 0.9372549057, green: 0.3490196168, blue: 0.1921568662, alpha: 1), for: .highlighted)
        btn.contentHorizontalAlignment = .left
        btn.addTarget(target, action: action, for: .touchUpInside)
        
        self.init(customView : btn)
    }
}
